package com.t5.bo;

import java.io.Serializable;

public abstract class AbstractEntity implements Serializable {
  protected Long id;

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    AbstractEntity that = (AbstractEntity) o;

    return !(id != null ? !id.equals(that.id) : that.id != null);
  }

  @Override
  public int hashCode() {
    return id != null ? id.hashCode() : -1;
  }

  @Override
  public String toString() {
    return "AbstractEntity{" +
      "id=" + id +
      '}';
  }
}
